﻿<phone:PhoneApplicationPage xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls" xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" xmlns:local="clr-namespace:WindowsPhone7UXGuide" d:DesignWidth="480" d:DesignHeight="800"
	x:Class="WindowsPhone7UXGuide.ContextMenu"
	mc:Ignorable="d"
	SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
	shell:SystemTray.IsVisible="True">

	<phone:PhoneApplicationPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</phone:PhoneApplicationPage.FontFamily>
	<phone:PhoneApplicationPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</phone:PhoneApplicationPage.FontSize>
	<phone:PhoneApplicationPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</phone:PhoneApplicationPage.Foreground>

	<!--LayoutRoot is the root grid where all page content is placed-->
	<Grid x:Name="LayoutRoot" Background="Transparent">
		<!--Pivot Control-->
		<controls:Pivot Title="CONTEXT MENU">
			<!--Pivot item one-->
			<controls:PivotItem Header="menu items">
				<Grid>
					<ListBox Margin="0,-3,0,0">
						<ListBox.Resources>
							<DataTemplate x:Name="DoubleLineListTemplate">
								<StackPanel Margin="12,8,0,2">
									<TextBlock Text="{Binding Line1}" HorizontalAlignment="Left" VerticalAlignment="Top" Padding="0,3,0,0" FontFamily="{StaticResource PhoneFontFamilyLight}" FontSize="{StaticResource PhoneFontSizeExtraLarge}" Foreground="{StaticResource PhoneForegroundBrush}" TextWrapping="Wrap" LineStackingStrategy="BlockLineHeight" LineHeight="43" />
									<TextBlock Text="{Binding Line2}" Opacity="0.65" HorizontalAlignment="Left" FontSize="{StaticResource PhoneFontSizeSmall}" TextWrapping="Wrap" VerticalAlignment="Top" Foreground="{StaticResource PhoneForegroundBrush}" FontFamily="{StaticResource PhoneFontFamilyNormal}" Margin="0,0,0,13"/>
								</StackPanel>
							</DataTemplate>
						</ListBox.Resources>
						<ListBoxItem ContentTemplate="{StaticResource DoubleLineListTemplate}" HorizontalContentAlignment="Left" Margin="0,0,0,4">
							<toolkit:ContextMenuService.ContextMenu>
								<toolkit:ContextMenu>
									<toolkit:MenuItem Header="Item 1"/>
									<toolkit:MenuItem Header="Item 2"/>
									<toolkit:MenuItem Header="Item 3"/>
									<toolkit:MenuItem Header="Item 4"/>
									<toolkit:MenuItem Header="Item 5"/>
								</toolkit:ContextMenu>
							</toolkit:ContextMenuService.ContextMenu>
							<local:MultiLineItem Line1="Largest (5 items)" Line2="Press and hold to view"/>
						</ListBoxItem>
						<ListBoxItem ContentTemplate="{StaticResource DoubleLineListTemplate}" HorizontalContentAlignment="Left" Margin="0,0,0,4">
								<toolkit:ContextMenuService.ContextMenu>
									<toolkit:ContextMenu>
										<toolkit:MenuItem Header="Item 1"/>
										<toolkit:MenuItem Header="Item 2"/>
										<toolkit:MenuItem Header="Item 3"/>
									</toolkit:ContextMenu>
								</toolkit:ContextMenuService.ContextMenu>
							<local:MultiLineItem Line1="Medium (3 items)" Line2="Press and hold to view"/>
						</ListBoxItem>
						<ListBoxItem ContentTemplate="{StaticResource DoubleLineListTemplate}" HorizontalContentAlignment="Left" Margin="0,0,0,4">
								<toolkit:ContextMenuService.ContextMenu>
									<toolkit:ContextMenu>
										<toolkit:MenuItem Header="Item 1"/>
									</toolkit:ContextMenu>
								</toolkit:ContextMenuService.ContextMenu>
							<local:MultiLineItem Line1="Smallest (1 item)" Line2="Press and hold to view"/>
						</ListBoxItem>
					</ListBox>
				</Grid>
			</controls:PivotItem>

 			<!--Pivot item two-->
		</controls:Pivot>
	</Grid>
</phone:PhoneApplicationPage>